/*
 * @Description: 
 * @Author: changqing
 * @Date: 2021-08-29 23:01:53
 * @LastEditTime: 2021-08-29 23:01:53
 * @LastEditors: changqing
 * @Usage: 
 */
var { of,timer,interval,Subject } = require("rxjs");
var { map, take,pairwise,startWith } = require("rxjs/operators");
interval(1000).pipe(
  take(6),
  map(data => data + 1),
  startWith(0), // 初始值
  pairwise() // 再搭配 pairwise时，就能让原始的Observable的第一个事件有上一个事件
).subscribe(result => {
  console.log(result);
});